﻿@using eCollabro.Client.Models.Content;
@using eCollabro.Client.Models.Core;
@using eCollabro.Web.Base;
@model DocumentModel
@if (!Request.IsAjaxRequest())
{
    @Scripts.Render("~/bundles/documentlibrary")
}
<div id="divDocumentHome" ng-controller="documentHomeController" ng-init="initialize()">
    @Html.Partial("_PageHeader", new PageHeaderModel { ViewId = "DocumentHome", PageTitle = "Document Library" })

    <div class="col-md-8">
        <div class="panel panel-default">
            <!-- Default panel contents -->
            <div class="panel-heading">Recent Documents <span class="badge">{{recentDocuments.length}}</span></div>
            <div class="panel-body">
                <ul class="list-group">
                    <li class="list-group-item" ng-repeat="document in recentDocuments">
                        <h4 class="list-group-item-heading"><a href="/Content/DocumentLibrary/Document/{{document.DocumentId}}">{{document.DocumentTitle}}</a></h4>
                        <p class="list-group-item-text"> {{document.DocumentDescription}}</p>
                    </li>
                </ul>
                <div ng-show="recentDocuments.length==0" class="text-info">There are no records to show.</div>
            </div>
        </div>
    </div>
    <div class="col-md-1"></div>
    <div style="min-height:40px" class="col-md-3">
        <div class="row">
            <div class="panel panel-default">
                <!-- Default panel contents -->
                <div class="panel-heading">Document Libraries <span class="badge">{{documentLibraries.length}}</span></div>
                <div class="panel-body">
                    <ul class="list-group">
                        <li class="list-group-item" ng-repeat="documentLibrary in documentLibraries">
                            <span class="badge">{{documentLibrary.NumberOfDocuments}}</span>
                            <a href="/Content/DocumentLibrary/Documents/{{documentLibrary.DocumentLibraryId}}">{{documentLibrary.DocumentLibraryName}}</a>
                        </li>
                    </ul>
                    <div ng-show="documentLibraries.length==0" class="text-info">There are no records to show.</div>
                </div>
            </div>

        </div>
    </div>
</div>
